import React, { Component } from 'react';

import Search from './components/Search/index.jsx';
import List from './components/List/index.jsx';

export default class App extends Component {
    state={
        users:[],
        isFirst:true,
        isLoading:false,
        err:""
    };
    // 将每次搜索的数据存放入users中
    // saveUsers=(users)=>{
    //     this.setState({
    //         users
    //     });
    // };
    // 每次点击搜索更新数据状态
    updateState=(stateObj)=>{
        this.setState(stateObj);
    };
    render() {
        return (
            <div className="container">
                {/* <Search saveUsers={this.saveUsers}></Search> */}
                <Search updateState={this.updateState}></Search>
                <List {...this.state}></List>
            </div>
        )
    }
}
